import java.util.Scanner;

public class Main1 {
    public static boolean fun(int n) {
        int sum = 0;
        for (int i = 1; i < n; i++) {
            if (n % i == 0) {
                sum += i;
            }
        }

        return sum == n;
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int n = scanner.nextInt();
        int count = 0;
        for (int i = 6; i <= n; i++) {
            if (fun(i)) {
                count++;
            }
        }
        System.out.println(count);
    }
}
